package com.hg.miaosha.repository;

import com.baomidou.mybatisplus.plugins.Page;
import com.hg.miaosha.dto.PageDTO;
import com.hg.miaosha.entity.Seckill;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * created by skh on 2019/6/15
 */
public interface SeckillRepository {

	Page getSeckillGoodsList(PageDTO pageDTO);

	Seckill getGoodsStockBySeckillId(Integer seckillId);

	void decreaseStockBySeckillId(Integer seckillId);

	List<Seckill> getAllSeckillGoodsList();

	void updateSeckillById(Seckill seckill);

    Seckill getGoodsStockBySeckillIdWithPessimisticLock(Integer seckillId);

	Integer updateSeckillNumberBySecKillId(Integer seckillId);

	Integer updateSeckillNumberBySecKillIdWithOptimisticLock(Integer seckillId, Integer version);
}
